home *** CD-ROM | disk | FTP | other *** search
- Path: eccdb1.pms.ford.com!usenet
- From: Randy Hanna <hanna@vd0001.pto.ford.com>
- Newsgroups: comp.lang.c++
- Subject: Directly Accessing Memory in Windows 3.1
- Date: Tue, 19 Mar 1996 15:09:17 -0800
- Organization: ECC at Ford Motor Company, Dearborn Michigan
- Message-ID: <314F3E9D.4086@vd0001.pto.ford.com>
- NNTP-Posting-Host: vd2012.pto.ford.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- I have a special hardware card for my PC that provides RF
- communication between an antenna and an RF tag. You communicate
- with this card putting instructions into its registers. The
- company that sells the card call it dual port memory.
-
- Essentially there are jumpers on the card that allow you to
- set the physical memory location the card will look at to
- get its instructions and store its data. For example,
- I set my jumpers to be xEA000 or 958464 in decimal.
-
- My question is, how can access memory directly in Windows 3.1 (using
- either Borland C++ or Visual C++).
-
- I have successfully the following to access address xD0000:
-
- Note: I don't know why or how this works, but it does!!!!
- ___________________________________________________________
-
- extern "C" WORD _D000h; //Note: I don't know where this is defined???
-
- LPSTR lpHS900Memory;
-
- lpHS900Memory = (LPSTR)MAKELONG(0,&_D000h);
-
- ___________________________________________________________
-
- The above gives me a direct pointer to physical memory location
- xD0000. Again, I don't how or why this works.
-
- So my question is there a general method (not using that
- extern "C" WORD _D000h stuff I don't understand)to obtain
- a pointer to any given physical memory address?
-
- Thanks in advance for any help.
-